﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;

public class NetClient : NetworkBehaviour
{
    private void Start()
    {
        NetworkClient.Connect("127.0.0.1");
        Debug.Log("客户端开启连接服务器" + "127.0.0.1");

    }

    public override void OnStartClient()
    {
        base.OnStartClient();
        //NetworkClient.RegisterHandler<NetMsg>(OnClientRecieve, true);
        NetworkClient.RegisterHandler<NetMessage>(OnClientRecieve, false);
        Debug.Log("客户端开启");

    }



    private void OnClientRecieve(NetMessage message)
    {
        Debug.Log("接收到服务器消息" + message.Value);

    }
}
